/**
 * 
 */
package com.massyframework.beanskin.launcher.scanning.maven;


/**
 * {@link ArtifactItem},内嵌的项目
 * @author huangkh
 *
 */
class ArtifactItem extends Coordinate {

	/**
	 * @param builder
	 */
	public ArtifactItem(Builder builder) {
		super(builder);
	}

	/**
	 * 创建构建器
	 * @return {@link Builder}
	 */
	public static Builder newBuilder() {
		return new Builder();
	}
	
	/**
     * 使用{@code item}创建构建器
     * @param item {@link Coordinate}，坐标
     * @return {@link Builder}
     */
    public static Builder newBuilder(Coordinate item) {
    	return new Builder()
    			.groupId(item.getGroupId())
    			.artifactId(item.getArtifactId())
    			.version(item.getVersion());
    }

	public static class Builder extends Coordinate.Builder {
		
		protected String relativePath = "../pom.xml";
		
		/**
    	 * 设置GroupId
    	 * @param groupId {@link String}
    	 * @return {@link Builder}
    	 */
		@Override
    	public Builder groupId(String groupId) {
    		super.groupId(groupId);
    		return this;
    	}
    	
    	/**
    	 * 设置ArtifactId
    	 * @param artifactId {@link String}
    	 * @return {@link Builder}
    	 */
		@Override
    	public Builder artifactId(String artifactId) {
    		super.artifactId(artifactId);
    		return this;
    	}
    	
    	/**
    	 * 设置版本
    	 * @param version {@link String}
    	 * @return {@link Builder}
    	 */
		@Override
    	public Builder version(String version) {
    		super.version(version);
    		return this;
    	}
				
		/**
		 * 创建{@link ParentCoordinate}
		 */
		public ArtifactItem build() {
			return new ArtifactItem(this);
		}
	}
}
